const {Article} = require('../../model/article');
module.exports = async (req, res) => {
	req.app.locals.currentLink = 'article';
	if(req.query.id) {
		let article = await Article.findOne({_id: req.query.id});
		res.render('admin/article-edit', {
			articleId: req.query.id,
			article: article,
			isModify: true
		});
	}else {
		res.render('admin/article-edit', {
			isModify: false
		});
	}
}